<script type="text/javascript">
        $(document).ready(function(){

        $("#test").click(function(){
                      var file = document.getElementById('UploadFile').files[0];
            $.ajax({
                    async:true,
                    type:'post',
                    complete:function(request, json) {$('#return').html(request.responseText);},
                    url:'<?php echo Router::url(array('controller'=>'images','action'=> 'index')) ?>',
                    data: {"Upload":{"file":{"name": file.name,"type": file.type,"error":"0" ,"size": file.size}}},
                    dataType: 'json',
                    success: function(data){ $("#return").html(data); }
            });

            });

        });

    </script>

<?php
echo $this->Form->create('Upload', array('type' => 'file', 'url' => array('controller' => 'images', 'action' => $this->action)));
echo $this->Form->input('file', array('type' => 'file'));
echo $this->Form->button('choice', array('id'=>'test', 'type' =>'button' ));
echo $this->Form->end('Upload');
?>
<div id="return"></div>